/*
   Copyright 2010 the original author or authors

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
package com.googlecode.flightreports.countrysummary;

import com.googlecode.kohmori.reportgen.SimplePDFGenerator;
import com.googlecode.kohmori.springmvc.DefaultReportParams;
import javax.xml.transform.Transformer;

/**
 * This is an arbitrary subclassing of SimplePDFGenerator,
 * just being used here to show how you can pass report parameter
 * values to the stylesheet, to be used in generating the report. 
 * Parameters set here are matched in xslt:param elements in the
 * stylesheet, matched on the first argument of the setParameter()
 * method.
 * 
 * If you do not have any such xslt:param elements in your stylesheet,
 * you would *not* need to create this subclass--just rely on the
 * SimplePDFGenerator in your reports-servlet.xml Spring config 
 * file instead.
 * 
 */
public class ReportPDFGen extends SimplePDFGenerator {
    
    @Override
    protected void addTransformerParameters(Transformer transformer, 
            DefaultReportParams rP) {
        transformer.setParameter("report_title", 
                "Country Summary Report");
    }
   
}
